import { SpaceEnter } from "space_enter.slint";

// support space or enter event, and support mouse clicked and mouse cursor
export component TouchSpaceEnter {
    in property <bool> touch_enabled: true;
    in property <bool> space_enter_enabled: true;
    in property <MouseCursor> mouse_cursor: MouseCursor.pointer;
    out property <bool> has_hover <=> touch.has-hover;
    out property <bool> has-focus <=> se.has-focus;

    width: 100%;
    height: 100%;

    callback clicked;

    touch:= TouchArea {
        enabled: root.touch_enabled;
        mouse-cursor: root.mouse_cursor;

        clicked => {
            root.clicked();
        }
    }

    se:= SpaceEnter {
        enabled: root.space_enter_enabled;

        clicked => {
            root.clicked();
        }
    }
}